import request from '@/utils/request';

export type OnlineCashier = {
  uniacid: string;
  store_id: string;
};
export type CatgrayGoods = {
  uniacid: string;
  store_id: string;
  cashier_id: string | undefined;
  category: string;
  rows?: string | number;
  page?: string | number;
  type?: string;
  isFissionScale?: boolean;
  search?: string;
  a?: string | number;
};

export type Catgray = {
  uniacid: string;
  store_id: string;
  cashier_id: string | undefined;
};

/**
 * @description: 获取 当前收银员 id
 * @param {*}
 * @return {*}
 */
export function getOnlineCashierid(params?: OnlineCashier) {
  return request('getOnlineCashier', {
    method: 'POST',
    data: params,
  });
}

/**
 * @description: 获取某一分类的所有商品
 * @param {*}
 * @return {*}
 */
export function getCatgrayGoods(params?: CatgrayGoods) {
  return request('getgoods2', {
    data: params,
  });
}

/**
 * @description: 获取所有分类
 * @param {CatgrayGoods} params
 * @return {*}
 */
export function getCatgray(params?: Catgray) {
  return request('getcategory', {
    data: params,
  });
}
/**
 * @description: 挂单
 * @param {any} params
 * @return {*}
 */
export function setPendingOrder(params?: any) {
  return request('setPendingOrder', {
    data: params,
  });
}

/**
 * @description: 获取挂单订单
 * @param {any} params
 * @return {*}
 */
export function getTablePendingOrder(params?: any) {
  return request('getTablePendingOrder', {
    data: params,
  });
}
